home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
TypeMatcher.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-23
|
2KB
|
61 lines
#ifndef TypeMatcher_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define TypeMatcher_First
#include "Object.h"
#include "Symbol.h"
class OrdCollection;
//---- file types --------------------------------------------------------------
extern const char *cMagic; // magic cookie for ET++ generated files
extern Symbol
cDocTypeUndef, // "UNDEF" document type
cDocTypeAscii, // document type for ordinary ascii-files
cDocTypeET, // ET++ file format
cDocTypeCPlusPlus,
cDocTypeC,
cDocTypeCHeader,
cDocTypeDirectory, // System directory
cDocTypeSpecial; // System special file
extern
Symbol cDocCreatorUndef; // Creator of document unknown
//---- TypeMatcher -------------------------------------------------------------
class TypeMatcher: public Object {
public:
MetaDef(TypeMatcher);
TypeMatcher(Symbol t, char *ext, char *tag, bool ia, int prio= 1000);
~TypeMatcher();
static void AddMatcher(TypeMatcher *m);
static TypeMatcher *MatchByName(char *bp, int len);
static TypeMatcher *MatchByContents(char *name);
protected:
virtual bool MatchExtension(char *extension);
virtual bool MatchPathName(char *pathname, int len);
virtual bool MatchNameAndContents(char *pathname, char *buf, int len);
virtual bool MatchContents(char *buf, int len);
int Compare(Object *op);
public:
Symbol creator, type;
char *extension, *tag;
bool ascii, isCCode, isETFormat;
int priority;
private:
static OrdCollection *matchers;
static bool sorted;
};
#endif